package com.bishe.app.core.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * Created : 2024/3/13, 19:34
 *
 * @author : jeffrey.hu
 **/
@AllArgsConstructor
@Getter
public enum Is {
    N(0, "NO"),
    Y(1, "YES"),
    ;

    private Integer code;

    private String desc;


    public static Is ofCode(Integer code) {
        for (Is value : values()) {
            if (Objects.equals(value.getCode(), code)) {
                return value;
            }
        }
        return null;
    }
}
